<?php

namespace common\models\credit_app_tables;

use Yii;

/**
 * This is the model class for table "{{%department}}".
 *
 * @property int $dp_id
 * @property string $dp_code 部门编号
 * @property string $dp_name 部门名称
 * @property string $dp_province 所在省市
 * @property string $dp_city 市
 * @property string $dp_bank 授权银行
 * @property string $dp_status
 */
class Department extends \yii\db\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%department}}';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db_app');
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['dp_code', 'dp_name', 'dp_province', 'dp_city', 'dp_bank'], 'required'],
            [['dp_bank', 'dp_status'], 'string'],
            [['dp_code', 'dp_name', 'dp_province', 'dp_city'], 'string', 'max' => 30],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'dp_id' => Yii::t('app', 'Dp ID'),
            'dp_code' => Yii::t('app', '部门编号'),
            'dp_name' => Yii::t('app', '部门名称'),
            'dp_province' => Yii::t('app', '所在省市'),
            'dp_city' => Yii::t('app', '市'),
            'dp_bank' => Yii::t('app', '授权银行'),
            'dp_status' => Yii::t('app', 'Dp Status'),
        ];
    }
}
